<template>
  <div>
    <!-- 轮播图 -->
    <!-- <mt-swipe :auto="4000">
      <mt-swipe-item v-for="item in lunbotu" :key="item.id">
        <img :src="item.img" alt="1" />
      </mt-swipe-item>
    </mt-swipe> -->
    <!-- 父组件向子组件传值 -->
    <swiper :lunbotu="lunbotu" :imgname="'img'" :isfull="true"></swiper> 
    <!-- 九宫格 -->
    <ul class="mui-table-view mui-grid-view mui-grid-9">
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="/home/newsList">
          <!-- <span class="mui-icon mui-icon-home"></span> -->
          <img src="../../image/menu1.png" />
          <div class="mui-media-body">新闻资讯</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="/home/photoList">
          <img src="../../image/menu2.png" />
          <div class="mui-media-body">图片分享</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="/home/goodsList">
          <img src="../../image/menu3.png" />
          <div class="mui-media-body">商品购买</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../../image/menu4.png" />
          <div class="mui-media-body">留言反馈</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../../image/menu5.png" />
          <div class="mui-media-body">视频专区</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../../image/menu6.png" />
          <div class="mui-media-body">联系我们</div>
        </a>
      </li>
    </ul>
    <!-- <h1>home</h1> -->
  </div>
</template>
<script>
// 1.导入轮播图子组件
import swiper from '../sub-components/Swiper.vue'
export default {
  data() {
    return {
      // 轮播图数组
      lunbotu: []
    };
  },
  created() {
    this.getlunbotu();
  },
  methods: {
    async getlunbotu() {
      const { data } = await this.$http.get("/api/getlunbo");
      console.log(data);
      if (data.status === 0) {
        this.lunbotu = data.message;
      }
    }
  },
  // 2.注册子组件
  components:{
    swiper
  }
};
</script>
<style lang="scss" scoped>
.mint-swipe {
  height: 200px;
  .mint-swipe-item {
    img {
      width: 100%;
      height: 100%;
    }
  }
}
.mui-grid-view {
  li {
    img {
      width: 60px;
      height: 60px;
    }
  }
}

.mui-grid-view.mui-grid-9{
  background-color: white;
  border: 0;
}
.mui-grid-view.mui-grid-9 .mui-table-view-cell{
  border: 0;
}
.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body{
  font-size: 12px;
}
</style>